<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">

            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:sell:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:sell:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:sell:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:sell:export">
                    <i class="fa fa-download"></i> 导出
                 </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:sell:edit')}]];
        var removeFlag = [[${@permission.hasPermi('system:sell:remove')}]];
        var prefix = ctx + "system/sell";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "【请填写功能名称】",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'sellId',
                    title : '销售id'
                },
                {
                    field : 'storageId',
                    title : '入库id'
                },
                {
                    field : 'carCard',
                    title : '车牌号'
                },
                {
                    field : 'cardTime',
                    title : '上牌时间'
                },
                {
                    field : 'sellAddre',
                    title : '上牌区域'
                },
                {
                    field : 'carLy',
                    title : '领域'
                },
                {
                    field : 'carPerpen',
                    title : '车主/购买单位'
                },
                {
                    field : 'carNum',
                    title : '车辆行驶证编号'
                },
                {
                    field : 'sellName',
                    title : '销售人员'
                },
                {
                    field : 'sellDrivingDate',
                    title : '行驶证时间'
                },
                {
                    field : 'sellDate',
                    title : '销售日期'
                },
                {
                    field : 'sellInvoiceDate',
                    title : '开发票日期'
                },
                {
                    field : 'sellInvoiceCard',
                    title : '发票编号'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.sellId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.sellId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>
